<script type="text/javascript" src="<?=base_url();?>FusionWidgets/Charts/FusionCharts.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $("#tabs").tabs();
    });
</script>
<style>
    .ui-tabs .ui-tabs-hide {
        display: none;
    }
</style>

<!-- cuerpo -->
<div id="yui-main">
    <div class="yui-b">
        <div class="yui-g">



            <div class="demo">

                <div id="tabs">
                    <ul>
                        <li style="list-style-type: none"><a href="#tabs-1">Casiba</a></li>
                        <li style="list-style-type: none"><a href="#tabs-2">Ind. Basica</a></li>
                    </ul>
                    <div id="tabs-1">
                        <?php

                        if($this->session->userdata('logged_in')) {
                            $this->modelo_noticias->get_noticias('empresa1', 'privado');
                        }else {
                            $this->modelo_noticias->get_noticias('empresa1', 'publico');
                        }


                        if($this->session->userdata('logged_in')):?>
                        <div class="ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix">
                            <h1>Panel de Control</h1>
                        </div>
                        <div id="gbox_editgrid" class="ui-jqgrid ui-widget ui-widget-content ui-corner-all" dir="ltr" style="padding:5px;">
                            <div id="chartdiv" style="width:300px; float:left">
                                The chart will appear within this DIV. This text will be replaced by the chart.
                            </div>
                            <div id="chartdiv2" style="width:300px; float:left">
                                The chart will appear within this DIV. This text will be replaced by the chart.
                            </div>
                            <div id="chartdiv3">
                                The chart will appear within this DIV. This text will be replaced by the chart.
                            </div>
                            <script type="text/javascript">
                                var myChart = new FusionCharts("<?=base_url();?>FusionWidgets/Charts/AngularGauge.swf", "myChartId", "300", "150", "0", "0");
                                myChart.setDataURL("<?=base_url();?>index.php/home/grafico/12");
                                myChart.render("chartdiv");
                            </script>
                            <script type="text/javascript">
                                var myChart = new FusionCharts("<?=base_url();?>FusionWidgets/Charts/AngularGauge.swf", "myChartId", "300", "150", "0", "0");
                                myChart.setDataURL("<?=base_url();?>index.php/home/grafico/25");
                                myChart.render("chartdiv2");
                            </script>
                            <script type="text/javascript">
                                var myChart = new FusionCharts("<?=base_url();?>FusionWidgets/Charts/AngularGauge.swf", "myChartId", "300", "150", "0", "0");
                                myChart.setDataURL("<?=base_url();?>index.php/home/grafico/90");
                                myChart.render("chartdiv3");
                            </script>
                        </div>
                        <div style="height:5px"></div><!-- separator -->


                        <div style="height:5px"></div><!-- separator -->
                        <?php endif;?>


                        <?php foreach ($this->modelo_noticias->datos->result() as $row):?>
                        <div class="ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix">
                            <h1><?=$row->nombre?></h1>
                        </div>
                        <div id="gbox_editgrid" class="ui-jqgrid ui-widget ui-widget-content ui-corner-all" dir="ltr" style="padding:5px;">
                            <table class="noticias" border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tr>
                                    <td colspan="2" align="right">
                                        <a href="<?=base_url();?>index.php/noticias_empresa1/pdf/<?=$row->id?>"><img src="<?=base_url();?>images/pdf.gif"></a>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2"><?=$row->texto?></td>
                                </tr>
                                <tr>
                                    <td align="left">
                                            <?php
                                            if ($row->texto_ampliado):?>
                                        <a href="<?=base_url();?>index.php/noticias_empresa1/ampliar/<?=$row->nombre?>"><?=lang('ampliar_portada_noticias');?></a><br />
                                            <?php endif;?>

                                            <?php if($this->modelo_modulos->get_permisos_modificar('noticias_empresa1_login','empresa1')=='si'):?>
                                        <a href="<?=base_url();?>index.php/noticias_empresa1/editar/<?=$row->id?>"><?=lang('editar_portada_noticias');?></a>
                                            <?endif;?>
                                    </td>
                                    <td align="right">
                                            <?php $this->modelo_noticias->get_comentarios_total($row->id);?>
                                        <a href="<?=base_url();?>index.php/noticias_empresa1/crear_comentario/<?=$row->id?>">(+)</a>
                                            <?php if($this->modelo_noticias->numero_de_comentarios=="0"):?>
                                        Comentarios(0)
                                            <?php else:?>
                                        <a href="<?=base_url();?>index.php/noticias_empresa1/lista_comentario/<?=$row->id?>">Comentarios(<?=$this->modelo_noticias->numero_de_comentarios?>)</a>
                                            <?php endif;?>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div style="height:5px"></div><!-- separator -->
                        <?php endforeach;?>

                    </div>
                    <div id="tabs-2">

                        <?php

                        if($this->session->userdata('logged_in')) {
                            $this->modelo_noticias->get_noticias('empresa2', 'privado');
                        }else {
                            $this->modelo_noticias->get_noticias('empresa2', 'publico');
                        }


                        if($this->session->userdata('logged_in')):?>
                        <div class="ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix">
                            <h1>Panel de Control</h1>
                        </div>
                        <div id="gbox_editgrid" class="ui-jqgrid ui-widget ui-widget-content ui-corner-all" dir="ltr" style="padding:5px;">
                            <div id="chartdiv_1" style="width:300px; float:left">
                                The chart will appear within this DIV. This text will be replaced by the chart.
                            </div>
                            <div id="chartdiv_2" style="width:300px; float:left">
                                The chart will appear within this DIV. This text will be replaced by the chart.
                            </div>
                            <div id="chartdiv_3">
                                The chart will appear within this DIV. This text will be replaced by the chart.
                            </div>
                            <script type="text/javascript">
                                var myChart = new FusionCharts("<?=base_url();?>FusionWidgets/Charts/AngularGauge.swf", "myChartId", "300", "150", "0", "0");
                                myChart.setDataURL("<?=base_url();?>index.php/home/grafico/12");
                                myChart.render("chartdiv_1");
                            </script>
                            <script type="text/javascript">
                                var myChart = new FusionCharts("<?=base_url();?>FusionWidgets/Charts/AngularGauge.swf", "myChartId", "300", "150", "0", "0");
                                myChart.setDataURL("<?=base_url();?>index.php/home/grafico/25");
                                myChart.render("chartdiv_2");
                            </script>
                            <script type="text/javascript">
                                var myChart = new FusionCharts("<?=base_url();?>FusionWidgets/Charts/AngularGauge.swf", "myChartId", "300", "150", "0", "0");
                                myChart.setDataURL("<?=base_url();?>index.php/home/grafico/90");
                                myChart.render("chartdiv_3");
                            </script>
                        </div>
                        <div style="height:5px"></div><!-- separator -->


                        <div style="height:5px"></div><!-- separator -->
                        <?php endif;?>


                        <?php foreach ($this->modelo_noticias->datos->result() as $row):?>
                        <div class="ui-jqgrid-titlebar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix">
                            <h1><?=$row->nombre?></h1>
                        </div>
                        <div id="gbox_editgrid" class="ui-jqgrid ui-widget ui-widget-content ui-corner-all" dir="ltr" style="padding:5px;">
                            <table class="noticias" border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tr>
                                    <td colspan="2"><?=$row->texto?></td>
                                </tr>
                                <tr>
                                    <td align="left">
                                            <?php if ($row->texto_ampliado):?>
                                        <a href="<?=base_url();?>index.php/noticias/ampliar/<?=$row->nombre?>"><?=lang('ampliar_portada_noticias');?></a><br />
                                            <?php endif;?>

                                            <?php if($this->modelo_modulos->get_permisos_modificar('noticias_empresa1_login','empresa1')=='si'):?>
                                        <a href="<?=base_url();?>index.php/noticias_empresa1/editar/<?=$row->id?>"><?=lang('editar_portada_noticias');?></a>
                                            <?endif;?>
                                    </td>
                                    <td align="right">
                                            <?php $this->modelo_noticias->get_comentarios_total($row->id);?>
                                        <a href="<?=base_url();?>index.php/noticias_empresa1/crear_comentario/<?=$row->id?>">(+)</a>
                                            <?php if($this->modelo_noticias->numero_de_comentarios=="0"):?>
                                        Comentarios(0)
                                            <?php else:?>
                                        <a href="<?=base_url();?>index.php/noticias_empresa1/lista_comentario/<?=$row->id?>">Comentarios(<?=$this->modelo_noticias->numero_de_comentarios?>)</a>
                                            <?php endif;?>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div style="height:5px"></div><!-- separator -->
                        <?php endforeach;?>

                    </div>
                </div>

            </div><!-- End demo -->






        </div>
    </div>
</div>